package com.ziguang.redwood.admin.validator;

import com.jfinal.core.Controller;
import com.jfinal.validate.Validator;

public class ProductValidatro extends Validator{

	@Override
	protected void validate(Controller c) {
		validateRequiredString("product_name", "productNameMsg", "产品名称为空");
		validateRequiredString("product_info", "productInfoMsg", "产品信息为空为空");
		validateRequiredString("type_id", "typeIdMsg", "为选择产品分类信息");
		validateRequiredString("sort", "sortMsg", "排序信息为空");
	}

	@Override
	protected void handleError(Controller c) {
		c.renderJson("{\"code\",1}");
	}
	
}
